package com.moutai.wmo.management.controller;

import com.moutai.wmo.core.result.ResponseResult;
import com.moutai.wmo.core.result.ResultUtil;
import com.moutai.wmo.management.dao.StorageDao;
import com.moutai.wmo.management.model.Storage;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("storage")
public class StorageController {

    @Autowired
    private StorageDao storageDao;

    @ResponseBody
    @RequestMapping("in") //完整地址：/wmo/storage/in
    public ResponseResult<Object> inStorage() {
        List<Storage> list = storageDao.selectList(null);
        return ResultUtil.successData(list);
    }

    @ResponseBody
    @RequestMapping("out")
    public ResponseResult<Object> outStorage() {
        return ResultUtil.success();
    }
}
